package main

import "fmt"
import "os"

/*
	从IO中读取：
		func Fscan(r io.Reader, a ...interface{}) (n int, err error)
		func Fscanln(r io.Reader, a ...interface{}) (n int, err error)
		func Fscanf(r io.Reader, format string, a ...interface{}) (n int, err error)
*/
func main() {
	f, _ := os.Open("fprint.dat")
	defer f.Close()

	str := ""
	str1 := ""

	// fmt.Fscan(f, &str, &str1)
	// fmt.Println("Fscan: ", str, str1) // Fscan:  helloworld golang

	// fmt.Fscanln(f, &str, &str1)
	// fmt.Println("Fscanln: ", str, str1) // Fscanln:  helloworld
	fmt.Fscanf(f, "%s %s", &str, &str1)
	fmt.Println("Fscanf: ", str, str1) // helloworld
}
